package org.imlinker.message;

import java.util.ArrayList;

public class BlackList {

	public BlackList() {
		list = new ArrayList<String>();
	}

	public void addElement(String blackName) {
		list.add(blackName);
	}

	public void removeElement(String name) {
		for (int i = 0; i < list.size(); i++) {
			if (name.startsWith(list.get(i))) {
				list.remove(i);
				return;
			}
		}
	}

	public boolean isBlack(String name) {
		for (int i = 0; i < list.size(); i++) {
			if (name.startsWith(list.get(i))) {
				return true;
			}
		}

		return false;
	}

	private ArrayList<String> list;
}
